#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{

	char arr1[] = {"AABCD"};
	char arr2[] = {"BCDAA"};
	char* str1 = &arr1;
	char* str2 = &arr2;

	int n = 5;


	return 	prvoe(str1, str2, n);
}	

prvoe(char* str1,char* str2,int n)
{
	int flag = 0;
	for (int i = 0; i < n; i++)
	{
		left_move(str1, 1);
		if (*str1 == *str2)
		{
			flag = 1;
		}

	}
	return flag;
}

left_move(char* str, int n)
	{


		while (n != 0)
		{
			char* cur = str;
			char tmp = *cur;
			while (*(cur + 1) != '\0')
			{
				*cur = *(cur + 1);
				cur++;
			}

			*cur = tmp;
			n--;
		}
		return;
	}